Parse address for Yahoo reader, too.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 12 Dec 2005 17:12:59 +0000 (17:12 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 12 Dec 2005 17:12:59 +0000 (17:12 +0000)
gpsbabel/yahoo.c

index bd808f8c72f75e2cdeac856616bbe29bb8fa1830..095c86be92b107a10238af30a3d41883ac0ffee9 100644 (file)
@@ -33,11 +33,17 @@ arglist_t yahoo_args[] = {
 };
 
 static xg_callback     wpt_s, wpt_lat, wpt_lon, wpt_e;
+static xg_callback     wpt_addr, wpt_city, wpt_state, wpt_zip, wpt_country;
 
 static xg_tag_mapping gl_map[] = {
  { wpt_s,      cb_start, "/ResultSet/Result" },
  { wpt_lat,    cb_cdata, "/ResultSet/Result/Latitude" },
  { wpt_lon,    cb_cdata, "/ResultSet/Result/Longitude" },
+ { wpt_addr,   cb_cdata, "/ResultSet/Result/Address" },
+ { wpt_addr,   cb_cdata, "/ResultSet/Result/City" },
+ { wpt_addr,   cb_cdata, "/ResultSet/Result/State" },
+ { wpt_addr,   cb_cdata, "/ResultSet/Result/Zip" },
+ { wpt_addr,   cb_cdata, "/ResultSet/Result/Country" },
  { wpt_e,      cb_end,   "/ResultSet/Result" },
  { NULL,       0,         NULL}
 };
@@ -87,6 +93,14 @@ void wpt_lon(const char *args, const char **unused)
        wpt_tmp->longitude = atof(args);
 }
 
+void   wpt_addr(const char *args, const char **unused)
+{
+       if (wpt_tmp->notes) {
+               wpt_tmp->notes = xstrappend(wpt_tmp->notes, ", ");
+       }
+       wpt_tmp->notes = xstrappend(wpt_tmp->notes, args);
+}
+
 ff_vecs_t yahoo_vecs = {
         ff_type_file,
        { ff_cap_read },